# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-simple-requests
pkgname=('python2-simple-requests' 'python-simple-requests')
_pkgname=simple-requests
pkgver=1.1.1
pkgrel=12
pkgdesc='Asynchronous requests in Python without thinking about it.'
arch=('any')
url='https://pypi.org/project/simple-requests/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('fe3899bef474e958364fe2601ff65f6873cddb5a670ce3bfad91b85e3f243749cbc584dec926328d593012d17e3305ca25d771fdb765b84236e504c71c43ed53')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-simple-requests() {
  depends=('python2' 'python2-requests' 'python2-gevent')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-simple-requests() {
  depends=('python' 'python-requests' 'python-gevent')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

